// 响应式storage
import { responsiveStorageNameSpace } from "@/config";
import Storage from "responsive-storage";
import type { App } from "vue";

export const injectResponsiveStorage = (app: App, config: PlatformConfigs) => {
  const nameSpace = responsiveStorageNameSpace();
  const configObj = Object.assign({
    // 系统配置-界面显示
    configure: {
      grey: config.Grey ?? false,
      weak: config.Weak ?? false,
      hideTabs: config.HideTabs ?? false,
      hideFooter: config.HideFooter ?? true,
      showLogo: config.ShowLogo ?? true,
      showModel: config.ShowModel ?? "smart",
      multiTagsCache: config.MultiTagsCache ?? false,
      stretch: config.Stretch ?? false
    }
  });

  app.use(Storage, { nameSpace, memory: configObj });
};
